home *** CD-ROM | disk | FTP | other *** search
/ PC World 2004 June / PCWorld_2004-06_cd.bin / software / vyzkuste / koolmoves / kmsetup.exe / {app} / Motion Scripts / Random / effect2.txt
Text File  |  2004-03-09  |  948b  |  34 lines

  1. // main_init function
  2.  
  3. main_init = function(mc){
  4. }
  5.  
  6. // main_effect function
  7.  
  8. main_effect = function(mc,frame){
  9.  if (subs_done) end_effect = true;
  10. }
  11.  
  12. // sub_init function
  13.  
  14. sub_init = function(mc){
  15.  mc.angle = Math.random() * deg360;
  16.  mc.distance = min_distance + Math.random() * (max_distance - min_distance);
  17.  mc.scale = mc._xscale = mc._yscale = Math.random() * 40 + 10; 
  18.  mc.x = mc._x = (center_cloud ? 0 : mc.__x) + Math.cos(mc.angle) * mc.distance;
  19.  mc.y = mc._y = (center_cloud ? 0 : mc.__y) - Math.sin(mc.angle) * mc.distance;
  20.  mc.rotation = mc._rotation = (sloppy ? Math.random() * 30 - 15 : 0);
  21. }
  22.  
  23. // sub_effect function
  24.  
  25. sub_effect = function(mc,frame){
  26.  perc = frame / lastsubframe; p2 = 1 - perc; 
  27.  mc._xscale = mc._yscale = perc * 100 + p2 * mc.scale;
  28.  mc._x = perc * mc.__x + p2 * mc.x;
  29.  mc._y = perc * mc.__y + p2 * mc.y;
  30.  mc._rotation = p2 * mc.rotation;
  31.  if (frame == lastsubframe) mc.done=true;
  32. }
  33.  
  34.